import Head from 'next/head'

interface SEOHeadProps {
  title?: string
  description?: string
  keywords?: string
  canonical?: string
}

export default function SEOHead({
  title = '族谱管理系统 - 在线家族族谱制作工具',
  description = '专业的在线族谱管理系统，支持家族族谱制作、家谱编辑、世系图生成。免费族谱模板，可视化家族关系图，支持PDF导出。',
  keywords = '族谱,家谱,族谱制作,家族族谱,世系图,家族关系图,族谱管理,家谱编辑,族谱模板,家族历史,宗谱,家族树',
  canonical
}: SEOHeadProps) {
  return (
    <Head>
      <title>{title}</title>
      <meta name="description" content={description} />
      <meta name="keywords" content={keywords} />
      {canonical && <link rel="canonical" href={canonical} />}
      
      {/* 移动端优化 */}
      <meta name="viewport" content="width=device-width, initial-scale=1.0" />
      <meta name="format-detection" content="telephone=no" />
      
      {/* 中文搜索引擎优化 */}
      <meta name="baidu-site-verification" content="your-baidu-verification" />
      <meta name="sogou_site_verification" content="your-sogou-verification" />
      <meta name="360-site-verification" content="your-360-verification" />
      
      {/* 社交媒体优化 */}
      <meta property="og:title" content={title} />
      <meta property="og:description" content={description} />
      <meta property="og:type" content="website" />
      <meta property="og:locale" content="zh_CN" />
      
      {/* 微信分享优化 */}
      <meta name="wechat:title" content={title} />
      <meta name="wechat:description" content={description} />
      
      {/* 预加载关键资源 */}
      <link rel="preload" href="/fonts/chinese-font.woff2" as="font" type="font/woff2" crossOrigin="" />
      
      {/* DNS预解析 */}
      <link rel="dns-prefetch" href="//fonts.googleapis.com" />
      <link rel="dns-prefetch" href="//cdn.jsdelivr.net" />
    </Head>
  )
}